package com.lgj.tlias.controller;

import com.lgj.tlias.domain.pojo.Dept;
import com.lgj.tlias.domain.pojo.Result;
import com.lgj.tlias.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController {
    //显示所有部门
    @Autowired
    public DeptService deptService;
/**
 * 查询部门列表
 */
    @GetMapping("/depts")
    public Result list(){
        List<Dept> depts = deptService.findAll();
        return Result.success(depts);
    }
}
